<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>体检记录管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            /*重置*/
            $("#btnReset").click(function () {
                $("#schoolCodeId").val("");
                $("#schoolCodeName").val("");
                $("#classCodeId").val("");
                $("#classCodeName").val("");
                $("#beginDate").val("");
                $("#endDate").val("");
                $("#student.stuCode").val("");
                $("#stuGrade").val("").select2();
            });
            //打印按钮点击时把传递参数到打印页面
            $("#btnPrint").click(function () {
                var serialize = $("#searchForm").serialize();
                window.open(ctx + '${adminPath}/childtijianrecord/childTijianRecord/printrecord?'+serialize)
            })
        });

        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
    <style type="text/css">
        .minWidth {
            min-width: 177px;
        }

        .autoWidth {
            width: auto;
        }

        .select2-choices {
            border-radius: 4px;
        }

        #contentTable td, #contentTable th {
            text-align: center;
            padding: 2px 5px;
        }

        #contentTable tbody tr td {
            font-size: 13px;
        }
    </style>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/childtijianrecord/childTijianRecord/">体检记录列表</a></li>
    <shiro:hasPermission name="childtijianrecord:childTijianRecord:edit">
        <li><a href="${ctx}/childtijianrecord/childTijianRecord/form">体检记录添加</a></li>
    </shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="childTijianRecord" action="${ctx}/childtijianrecord/childTijianRecord/"
           method="post" class="breadcrumb form-search" autocomplete="off">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <div class="breadcrumb">
        <table class="table table-bordered">
            <tr>
                <th>学校：</th>
                <td>
                    <sys:treeselect2 id="schoolCode" name="schoolCode" value="${childTijianRecord.schoolCode}"
                                     labelName="schoolName" labelValue="${childTijianRecord.schoolName}"
                                     title="学校" url="/sysschool/sysSchool/schTreeData" cssClass="input-medium"
                                     layer="true"/>
                </td>
                <th>年级：</th>
                <td>
                    <form:select path="student.stuGrade" id="stuGrade" class="span2 minWidth">
                        <form:option value="" label="--请选择--"/>
                        <form:options items="${fns:getDictList('stu_grade')}" itemLabel="label" itemValue="value"
                                      htmlEscape="false"/>
                    </form:select>
                </td>
                <th>班级：</th>
                <td>
                    <sys:treeselect2 id="classCode" name="classCode" value="${childTijianRecord.classCode}"
                                     labelName="className" labelValue="${childTijianRecord.className}"
                                     title="班级" url="/classinfo/classInfo/classTreeData" cssClass="input-medium"
                                     layer="true" notAllowSelectParent="true" notAllowSelectRoot="true"/>
                </td>
            </tr>
            <tr>
                <th>体检起始日期：</th>
                <td>
                    <input name="beginDate" id="beginDate" type="text" readonly="readonly" maxlength="20"
                           class="input-medium Wdate"
                           value="<fmt:formatDate value="${childTijianRecord.beginDate}" pattern="yyyy-MM-dd"/>"
                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                </td>
                <th>体检截止日期：</th>
                <td>
                    <input name="endDate" id="endDate" type="text" readonly="readonly" maxlength="20"
                           class="input-medium Wdate"
                           value="<fmt:formatDate value="${childTijianRecord.endDate}" pattern="yyyy-MM-dd"/>"
                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                </td>
                <th>学号：</th>
                <td>
                    <form:input path="student.stuCode" id="student.stuCode" class="span2 minWidth"/>
                </td>
            </tr>
        </table>
    </div>
    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
    <input id="btnReset" type="button" class="btn btn-primary" value="重置"/>
    <input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
    <input id="btnPrint" class="btn btn-primary" type="button" value="打印"/>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>序<br/>号</th>
        <shiro:hasPermission name="childtijianrecord:childTijianRecord:edit">
            <th>操 作</th>
        </shiro:hasPermission>
        <th>&nbsp;&nbsp;学校名称&nbsp;&nbsp;</th>
        <th>&nbsp;&nbsp;姓 名&nbsp;&nbsp;</th>
        <th>&nbsp;&nbsp;&nbsp;&nbsp;学 号&nbsp;&nbsp;&nbsp;&nbsp;</th>
        <th>性<br/>别</th>
        <th>&nbsp;&nbsp;年 级&nbsp;&nbsp;</th>
        <th>班 级</th>
        <th>身 高<br/>(cm)</th>
        <th>体 重<br/>(KG)</th>
        <th>BMI<br/>健康指标</th>
        <th>胸 围<br/>(cm)</th>
        <th>肺活量<br/>(ml)</th>
        <th>血 压<br/>(mmHg)</th>
        <th>脉 搏<br/>(分/次)</th>
        <th>左<br/>裸眼<br/>视力</th>
        <th>右<br/>裸眼<br/>视力</th>
        <th>左<br/>矫正<br/>视力</th>
        <th>右<br/>矫正<br/>视力</th>
        <th>沙 眼</th>
        <th>色 觉</th>
        <th>鼻 病</th>
        <th>左上<br/>口腔</th>
        <th>右上<br/>口腔</th>
        <th>左下<br/>口腔</th>
        <th>右下<br/>口腔</th>
        <th>心 脏</th>
        <th>&nbsp;&nbsp;肺&nbsp;&nbsp;</th>
        <th>&nbsp;&nbsp;肝 脾&nbsp;&nbsp;</th>
        <th>胃 肠</th>
        <th>脊 柱</th>
        <th>四 肢</th>
        <th>平 足</th>
        <th>皮 肤</th>
        <th>&nbsp;传&nbsp;<br/>&nbsp;染&nbsp;<br/>&nbsp;病&nbsp;</th>
        <th>&nbsp;&nbsp;淋&nbsp;&nbsp;<br/>&nbsp;&nbsp;巴&nbsp;&nbsp;<br/>&nbsp;&nbsp;结&nbsp;&nbsp;</th>
        <th>胸 透</th>
        <th>&nbsp;&nbsp;&nbsp;体检日期&nbsp;&nbsp;&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="childTijianRecord" begin="0" varStatus="status">
        <tr>
            <td>
                    ${(page.pageNo-1)*page.pageSize+status.index+1 }
            </td>
            <shiro:hasPermission name="childtijianrecord:childTijianRecord:edit">
                <td>
                    <a href="${ctx}/childtijianrecord/childTijianRecord/form?id=${childTijianRecord.id}">修改</a>
                    <a href="${ctx}/childtijianrecord/childTijianRecord/delete?id=${childTijianRecord.id}"
                       onclick="return confirmx('确认要删除该体检记录吗？', this.href)">删除</a>
                </td>
            </shiro:hasPermission>
            <td>
                    ${childTijianRecord.schoolName}
            </td>
            <td>
                    ${childTijianRecord.student.stuName}
            </td>
            <td>
                    ${childTijianRecord.student.stuCode}
            </td>
            <td>
                    ${fns:getDictLabel(childTijianRecord.student.gender,'sex','')}
            </td>
            <td>
                    ${fns:getDictLabel(childTijianRecord.student.stuGrade,'stu_grade','')}
            </td>
            <td>
                    ${childTijianRecord.className}
            </td>
            <td>
                    ${childTijianRecord.height}
            </td>
            <td>
                    ${childTijianRecord.weight}
            </td>
            <td>
                    ${childTijianRecord.status}
            </td>
            <td>
                    ${childTijianRecord.bust}
            </td>
            <td>
                    ${childTijianRecord.vitalCapacity}
            </td>
            <td>
                    ${childTijianRecord.blood}
            </td>
            <td>
                    ${childTijianRecord.pulse}
            </td>
            <td>
                    ${empty childTijianRecord.realLeftEye == 'true'? '5.0':childTijianRecord.realLeftEye}
            </td>
            <td>
                    ${empty childTijianRecord.realRightEye == 'true'? '5.0':childTijianRecord.realRightEye}
            </td>
            <td>
                    ${empty childTijianRecord.correctLeftEye == 'true'? '5.0':childTijianRecord.correctLeftEye}
            </td>
            <td>
                    ${empty childTijianRecord.correctRightEye == 'true'? '5.0':childTijianRecord.correctRightEye}
            </td>
            <td>
                    ${empty childTijianRecord.trachoma == 'true'? '无':childTijianRecord.trachoma}
            </td>
            <td>
                    ${empty childTijianRecord.colorsense == 'true'? '正常':childTijianRecord.colorsense}
            </td>
            <td>
                    ${empty childTijianRecord.nose == 'true'? '无':childTijianRecord.nose}
            </td>
            <td>
                    ${empty childTijianRecord.leftUpperMouth == 'true'? '无':childTijianRecord.leftUpperMouth}
            </td>
            <td>
                    ${empty childTijianRecord.rightUpperMouth == 'true'? '无':childTijianRecord.rightUpperMouth}
            </td>
            <td>
                    ${empty childTijianRecord.leftLowerMouth == 'true'? '无':childTijianRecord.leftLowerMouth}
            </td>
            <td>
                    ${empty childTijianRecord.rightLowerMouth == 'true'? '无':childTijianRecord.rightLowerMouth}
            </td>
            <td>
                    ${empty childTijianRecord.heart == 'true'? '正常':childTijianRecord.heart}
            </td>
            <td>
                    ${empty childTijianRecord.luny == 'true'? '正常':childTijianRecord.luny}
            </td>
            <td>
                    ${empty childTijianRecord.liver == 'true'? '未触及肿大':childTijianRecord.liver}
            </td>
            <td>
                    ${empty childTijianRecord.stomach == 'true'? '正常':childTijianRecord.stomach}
            </td>
            <td>
                    ${empty childTijianRecord.spine == 'true'? '正常':childTijianRecord.spine}
            </td>
            <td>
                    ${empty childTijianRecord.limb == 'true'? '正常':childTijianRecord.limb}
            </td>
            <td>
                    ${empty childTijianRecord.foot == 'true'? '无':childTijianRecord.foot}
            </td>
            <td>
                    ${empty childTijianRecord.skin == 'true'? '未见异常':childTijianRecord.skin}
            </td>
            <td>
                    ${empty childTijianRecord.contagion == 'true'? '无':childTijianRecord.contagion}
            </td>
            <td>
                    ${empty childTijianRecord.lymphGland == 'true'? '正常':childTijianRecord.lymphGland}
            </td>
            <td>
                    ${empty childTijianRecord.chestXray == 'true'? '未检':childTijianRecord.chestXray}
            </td>
            <td>
                    ${childTijianRecord.enrtYear}
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>